<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>添加好友</title>
    <link rel="stylesheet" href="/system/layui/src/css/layui.css" media="all" />
</head>
<body>
<form class="layui-form" style="width:80%;" action="javascript:void(0);">
    <div class="layui-form-item layui-row layui-col-xs12">
        <label class="layui-form-label">查询</label>
        <div class="layui-input-block">
            <input id="name" type="text" class="layui-input name" placeholder="请输入要查找的用户 ">
            <span style="color: red;">可以根据用户账号、昵称、电话号或邮箱进行查询</span>
        </div>
    </div>
    <div class="layui-row layui-col-space15" style="margin-left: 20%;" id="queryFriend"></div>
    <script type="text/javascript" src="/system/layui/src/layui.js"></script>
    <script type="text/javascript" src="/system/js/jquery-3.3.1.js"></script>
    <script type="text/javascript" src="/security/sysUser/addFriend.js"></script>
    <script type="text/javascript">
        function userClick(userId){
            layer.msg('数据提交中，请稍候',{icon: 16,time:false,shade:0.8});
            // 实际使用时的提交信息
            $.ajax({
                url:"/friend/add",
                type:"post",
                async: false,
                data:{
                    id:userId
                },
                success:function(res){
                    layer.msg(res);
                    setTimeout(function(){
                        layer.close(index);
                        layer.closeAll("iframe");
                    },1000);
                },
                error:function(res){
                    layer.msg("系统错误！");
                }
            });
            return false;
        }
    </script>
</form>
</body>
</html>